<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <#include "../decorator/head.html"/>
    <title>${applicationName}-定時任務</title>
</head>
<body>
<div class="row">
    <h5>定时任务管理</h5>
    <div id="data-search">
        <!-- 业务内容 -->
        <form method="post" id="search-form" class="form-inline form-search">
            <label class="form-label">任務ID</label>
            <input type="text" name="name" >&nbsp;&nbsp;
            <label class="form-label">任務標識</label>
            <input type="text" name="label" >&nbsp;&nbsp;
            <label class="form-label">执行时间</label>
            <input type="datetime-local" step="1" class="input-sm" name="locked_at_start" style="min-width:220px">~
            <input type="datetime-local" step="1" class="input-sm" name="locked_at_end">&nbsp;&nbsp;

            <button _func="query" type="submit" class="btn btn-sm btn-primary">查询</button>
        </form>
    </div>
    <div id="data-list"> </div>
    <!-- dialog -->
    <div id="data-dialog"> </div>
</div>
<script type="text/cc-template" id="template-data-list">
    <table class="table table-bordered table-hover table-condensed">
        <thead>
        <tr>
            <th>任務ID</th>
            <th>任務標識</th>
            <th title="也即任務鎖定時間">执行时间</th>
            <th>任務鎖定至</th>
            <th>任務執行机器</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {{#each data}}
        <tr>
            <td>{{name}}</td>
            <td>{{label}}</td>
            <td>{{locked_at}}</td>
            <td>{{lock_until}}</td>
            <td>{{locked_by}}</td>
            <td>{{_status status}}</td>
            <td>
                <a href="#" func="update">修改</a>
                <a href="#" func="delete">删除</a>
            </td>
        </tr>
        {{/each}}
        </tbody>
    </table>
    <#include "../decorator/page-form.html"/>
</script>
</body>
<!-- 底部静态 -->
<#include "../decorator/foot.html"/>
<script type="module">
    import { init } from "${ctxPath}/public/sys/sys_shedlock.js"
    init();
</script>
</html>
